/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package gui.event.vatnuoi;

import gui.event.ulti.Util;
import gui.vatnuoi.VNChiTiet_Dialog;
import gui.vatnuoi.VNSuaThongTin_Dialog;
import gui.vatnuoi.VNThem_Full;
import java.awt.print.PrinterException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTabbedPane;
import javax.swing.JTable;

/**
 *
 * @author nv_ca@live.com
 */
public class VNMainPanel_evt {

    public static final void btnThemActionPerformed() {
        VNThem_Full vnThemFull = new VNThem_Full(null, true);
        vnThemFull.setLocationRelativeTo(null);
        vnThemFull.setVisible(true);
    }

    public static final void btnSuaActionPerformed() {
        VNSuaThongTin_Dialog vnSuaDlg = new VNSuaThongTin_Dialog(null, true);
        vnSuaDlg.setLocationRelativeTo(null);
        vnSuaDlg.setVisible(true);
    }

    public static final void btnInActionPerformed(JTable table) {
        try {
            table.print();
        } catch (PrinterException ex) {
            Logger.getLogger(VNMainPanel_evt.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    public static final void btnChiTietActionPerformed() {
        VNChiTiet_Dialog vnChiTietDlg = new VNChiTiet_Dialog(null, true);
        vnChiTietDlg.setLocationRelativeTo(null);
        vnChiTietDlg.setVisible(true);
    }

    public static final void btnCloseActionPerformed(JPanel pnl, JTabbedPane jTabbedPane) {
        Util.closeATab(pnl.getName(), jTabbedPane);
    }

    public static final void btnLietKeActionPerformed() {
        JOptionPane.showMessageDialog(null, "Chỗ này dính tới query, làm sau.");
    }

    public static final void btlKhachHangFocusGained(List<JButton> listButtons, JTable table) {
//        if (table.getSelectedRowCount() == 1) 
            Util.enableListButtons(listButtons);
    }

    public static final void btlKhachHangFocusLost(List<JButton> listButtons) {
            Util.disableListButtons(listButtons);
    }

    public static final void enableListComponents(List<JComponent> components) {
        Util.enableListComponents(components);
    }

    public static final void disableListComponents(List<JComponent> components) {
        Util.disableListComponents(components);
    }
}
